package cn.majingjing.demo.zuul.web;

import cn.majingjing.demo.zuul.event.RefreshRouteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author JingjingMa
 * @date 2019/9/26 22:21
 */
@RestController
public class RefreshController {

    @Autowired
    RefreshRouteService refreshRouteService;

    @RequestMapping("/refreshRoute")
    public Object refreshRoute(){
        refreshRouteService.refreshRoute();
        Map<String,Object> result = new HashMap<>();
        result.put("code","200");
        return result;
    }

}
